<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!--{include file='comm/header.tpl'}-->
    <title>优惠券编号列表</title>
</head>
<body>

<div class="container">

    <div class="comm_crub">
            <span class="now_crub">优惠券编号列表</span>
            <button type="button" class="btn btn-primary" style="float: right;margin:4px 15px 0px 0px;" onclick="history.go(-1)">返回上一级</button>
        </div>

    <div class="comm_content">

            <div  class="search-box">
                <form id="searchForm" class="form-inline" onsubmit="return false;">
                    <div style="position:relative">
                        <span>
                            优惠券编号：
                            <input id="code" class="form-control input-sm" type="text" name="code" value="" style="width:140px">
                        </span>
                        <span>
                            使用状态：
                            <select name="used" class="form-control">
                                <option value="0">请选择</option>
                                <option value="1">未使用</option>
                                <option value="2">已使用</option>
                            </select>
                        </span>
                        <span>
                            <input type="button" class="btn btn-primary" value="查询" onclick="coupon.search();">&nbsp;&nbsp;
                        </span>
                    </div>
                </form>
            </div>

            <table id="flex" style="display:none"></table>

        </div>

</div>

<script type="text/javascript">
    $("#flex").flexigrid({
        url:"/invokingAjax-backend/promotion/coupon.ajax?operFlg=4&couponID=<!--{$couponID}-->",
        dataType: "json",
        colModel : [
            {display: "优惠券编号", width : 150, align: 'center'},
            {display: "会员号", width : 150, align : 'left' },
            {display: "生成时间", width : 150, align: 'center'},
            {display: "截止日期", width : 120, align: 'center'},
            {display: "使用时间", width : 150, align: 'center'},
            {display: "订单编号", width : 150, align : 'center'},
            {display: "使用金额", width : 100, align : 'right'}
        ],
        sortname: "createTime",
        sortorder: "asc",
        usepager: true,
        rp: 10,
        useRp: true
    });

    var coupon = {

        //查询
        search : function (){
            var dt = $("#searchForm").serializeArray();
            $("#flex").flexOptions({newp: 1, params: dt}).flexReload();
        }

    };


</script>

</body>
</html>